<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let str = `
            <ul>
                <li>
                    <a>《Java》</a>
                    <p>￥145.32</p>
                </li>
                <li>
                    <a>Vue</a>
                    <p>￥133.23</p>
                </li>
            </ul>
        `
        const reg = /<li>.*?<a>(.*?)<\/a>.*?<p>(.*?)<\/p>/sg
        const result = str.matchAll(reg)
        // for (const v of result) {
        //     console.log(v)
        // }
        console.log([...result])
    </script>
</body>
</html>